#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>

int main(int argc,char *argv[])
{

    int fd1,fd2,c=0,n=0;
    char ch;

    fd1=open(argv[1],O_RDONLY,0);
    if(fd1==-1)
    {
        printf("出现错误!");
        exit(1);
    }
    while(read(fd1,&ch,1)!=0)
      {
          if(ch=='\n') c++;
       }
    close(fd1);

    fd2=open(argv[1],O_RDONLY,0);
    while(read(fd2,&ch,1)!=0)
      {
          if(ch=='\n') n++;
          if(n>=c-10)printf("%c",ch);
       }

    close(fd2);
    exit(0);
}
